<%@page import="com.kaishengit.entity.FileType"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zh-CN"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		body{
			margin-top:70px;
		}
	</style>
</head>
<body class="body">
	
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="brand" href="main.jspx">Kaishengit PMS</a>
			</div>
		</div>
	</div>
	
	
	<div class="container">
	  <div class="row">
		<div class="span3">
			<div style="padding: 8px 0;" class="well">
				<ul class="nav nav-list">
				  <li class="nav-header">新Apple总部项目</li>
				  <li class="divider"></li>
				  <li><a href="#"><i class="icon-home"></i>最新动态</a></li>
				  <li>
					<a href="goal.jspx"><i class="icon-flag"></i>目标</a>
				  </li>
				  <li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>
				  <li class="active"><a href="#"><i class="icon-white icon-file"></i>文件共享</a></li>
				  <li><a href="contact.jspx"><i class="icon-user"></i>联系人</a></li>
				  <li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
				  <li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
				  <li><a href="#"><i class="icon-cog"></i>项目设置</a></li>
				</ul>
			</div>
		</div>
		<div class="span9">
			
			
			

			<a href="#myModal"  data-toggle="modal"  class="btn btn-primary" style="float: right;"><i class="icon-white  icon-share"></i>上传资料</a>
			
			
			
			
			
			<div class="modal hide" id="myModal">
				<form action="file.jspx?m=upload&id=${requestScope.fileTypeId}">
				  <div class="modal-header">
				    <button type="button" class="close" data-dismiss="modal">×</button>
				    <h3>上传资料</h3>
				  </div>
				  <div class="modal-body">
				     <textarea name="fileType" id="msg" style="width: 415px;" rows="1"  placeholder="#文件名#"  style="width: 400px; height: 75px; overflow: hidden; padding-bottom: 5px;border-radius:8px;"></textarea>
				  </div>
				  <div class="control-group">
					            <label for="fileInput" class="control-label"></label>
					            <div class="controls">
					              <input type="file" id="fileInput" class="input-file" name="myfile" >
					            </div>
					          </div>
				  <div class="modal-footer">
				    <a href="#" class="btn" data-dismiss="modal">关闭</a>
				    <input type="submit" class="btn btn-primary" value="上传"/>
				  </div>
				  </form>
			</div>
			
			
			<div class="clear"></div>
			
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
				<li class="active">
					<i class="icon-th"></i><a href="http://192.168.0.77/pms/file.html">文件共享</a>&gt;<a href="http://192.168.0.77/pms/task.html">客户资料</a>
				</li>
				<li style="float:right"><a href="http://192.168.0.77/pms/edit_goal.html" class="link-black" title="删除该文件夹"><i class="icon-trash"></i></a></li>
			</ul>
			<div class="wall">
				<table class="table table-striped">
					<thead>
						<tr>
							<th width="30px"></th>
							<th width="60%">名称</th>
							<th width="20%">大小</th>
							<th>创建人</th>
							<th></th>
						</tr>
					</thead>
					<tbody>
					
					<c:if test="${fn:length(requestScope.files) == 0 }">
			        	<tr >
			        		<td colspan="5">暂时没有共享资料</td>
			        	</tr>
			        </c:if>
					
					<c:forEach items="${requestScope.files }" var="file">
			          <tr>
			            <td>
			            	<c:choose>
			            		<c:when test="${file.fileMime == 'mp3' || file.fileMime == 'wma'} ">
			            			<img alt="" src="img/mp3.png">
			            		</c:when>
			            		<c:when test="${file.fileMime == 'rar' || file.fileMime == 'zip'}">
			            			<img alt="" src="img/winrar.png">
			            		</c:when>
			            		<c:when test="${file.fileMime == 'pdf'}">
			            			<img alt="" src="img/pdf.png">
			            		</c:when>
			            		<c:when test="${file.fileMime == 'word' || file.fileMime == 'ppt' || file.fileMime == 'excel'}">
			            			<img alt="" src="img/word.png">
			            		</c:when>
			            		<c:when test="${file.fileMime == 'png' || file.fileMime == 'jpeg' || file.fileMime == 'gif' || file.fileMime == 'jpg'}">
			            			<img alt="" src="img/image.png">
			            		</c:when>
			            		<c:when test="${file.fileMime == 'exe' }">
			            			<img alt="" src="img/exe.png">
			            		</c:when>
			            		<c:otherwise>
			            			<img alt="" src="img/file.png">
			            		</c:otherwise>
			            	</c:choose>
			            </td>
			            <td>
			            	<a href="file.jspx?m=download&id=${file.id }">${file.name }</a>
			            </td>
			            <td>
							${file.filesize }
			            </td>
			            <td>${file.employee.username }</td>
			            <td><a title="删除" id="delme" href="file.jspx?m=del_file&id=${file.id }&ftid=${requestScope.fileTypeId}"><i class="icon-trash"></i></a></td>
			          </tr>
			          
						<tr>
							<td>
								<img src="singlefile_files/file.png">
							</td>
							<td><a href="#">${type.name }</a></td>
							<td>5.5MB</td>
							<td>樊凯</td>
							<td><a href=""><i class="icon-trash"></i></a></td>
						</tr>
					
					
					</c:forEach>
						
					</tbody>
				</table>
				
				<a href="file.jspx">←返回</a>
			</div>
			
			
		</div>
	  </div>
	</div>

</body></html>